package com.jnxx.task.taskRemind;

import cn.hutool.core.date.DateUtil;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class MessageProducer {

    @Autowired
    MessageDelyQueueService delyQueueService;
    /**
     * 发送数据
     * @param taskId 消息
     * @param dely 延迟多久（秒）
     */
    public Boolean pushMessage(Long taskId, int dely){
        log.info("放入队列:{},现在时间:{},延迟:{}",taskId, DateUtil.now(),dely);
        return delyQueueService.pushMessage(taskId,dely);
    }
}
